﻿using System;
using System.Collections.Generic;
using System.Globalization;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using ChineseSchool.BLL;
using ChineseSchool.Models.Hethong;

namespace ChineseSchool.UserControl.ThuNghiem
{
    public partial class GuongMatTieuBieu : System.Web.UI.UserControl
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if (IsPostBack) return;
            lblTopUser.Text = LoadTopUserContent();
        }

        public string LoadTopUserContent()
        {            
            var strUsers = "";
            var lstTopUsers = new B_User().SelectTopUsers();
            if (lstTopUsers != null && lstTopUsers.Count > 0)
            {
                strUsers += "<ul class=\"ccr-latest-post\">";
                foreach (M_User user in lstTopUsers)
                {
                    strUsers += "<li>";
                    strUsers += "    <div class=\"ccr-thumbnail\">";
                    strUsers += "        <img src=\"" + user.Avatar + "\" alt=\"" + user.UserName + "\">";
                    strUsers += "        <p><a href=\"#\">Chi tiết</a></p>";
                    strUsers += "    </div>";
                    strUsers += "    <h4><a class=\"text-center\" href=\"#\">" + user.UserName + "</a></h4>";
                    strUsers += "</li>";
                }
                strUsers += "</ul>";
            }
            return strUsers;
        }

    }
}